import { createRouter, createWebHistory, type RouteRecordRaw } from 'vue-router'
import HomeView from '../views/HomeView.vue'

type CusRouteRecordRaw = RouteRecordRaw & {
  cmpName: string
}

const routes: CusRouteRecordRaw[] = [
  {
    cmpName: '主页',
    path: '/',
    name: 'HomeView',
    component: HomeView,
  },
  {
    cmpName: '关于',
    path: '/AboutView',
    name: 'AboutView',
    component: () => import('../views/AboutView.vue'),
  },
  {
    cmpName: '基础表格',
    path: '/FoundationTable',
    name: '/FoundationTable',
    component: () => import('../views/FoundationTable.vue'),
  },
  {
    cmpName: '基础表格1',
    path: '/FoundationTableV1',
    name: '/FoundationTableV1',
    component: () => import('../views/FoundationTableV1.vue'),
  },
  {
    cmpName: '项目内表格测试1',
    path: '/VxeGridCmpTest1',
    name: '/VxeGridCmpTest1',
    component: () => import('../views/VxeGridCmpTest1.vue'),
  },
  {
    cmpName: '表格分组测试',
    path: '/VxeGridGroupTest',
    name: '/VxeGridGroupTest',
    component: () => import('../views/VxeGridGroupTest.vue'),
  },
  {
    cmpName: '合并单元格',
    path: '/MergeCells',
    name: '/MergeCells',
    component: () => import('../views/MergeCells.vue'),
  },
  {
    cmpName: '合并单元格和虚拟滚动',
    path: '/VxeGridCmpTest',
    name: '/VxeGridCmpTest',
    component: () => import('../views/VxeGridCmpTest.vue'),
  },
  {
    cmpName: '合并单元格大数据',
    path: '/MergeCellsBigData',
    name: '/MergeCellsBigData',
    component: () => import('../views/MergeCellsBigData.vue'),
  },
  {
    cmpName: '编辑数据',
    path: '/EditorView',
    name: '/EditorView',
    component: () => import('../views/EditorView.vue'),
  },
  {
    cmpName: '列全局设置',
    path: '/VxeGridColGlobalSetView',
    name: '/VxeGridColGlobalSetView',
    component: () => import('../views/VxeGridColGlobalSetView.vue'),
  },
]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: routes,
})

export default router

export { routes }
